using UnityEngine;
using UnityEngine.UI;

public class ShareScreenshotScreen : UIScreen
{
	public Button tweetButton;

	public RawImage ssImage;

	public Button closeButton;

	private Texture2D texture;

	private void Start()
	{
		tweetButton.onClick.AddListener(ShareOnTwitter);
		closeButton.onClick.AddListener(delegate
		{
			UIScreenController.instance.OpenMenu();
		});
	}

	public override void ShowScreen()
	{
		ssImage.texture = CaptureScreenshot.instance.ScreenshotWithLogoTexture;
		ssImage.rectTransform.sizeDelta = new Vector2(ssImage.rectTransform.sizeDelta.y * ((float)ssImage.texture.width / (float)ssImage.texture.height), ssImage.rectTransform.sizeDelta.y);
	}

	public override void HideScreen()
	{
		base.HideScreen();
		GameManager.Instance.screenshotTaken = false;
	}

	public void ShareOnTwitter()
	{
		if (ssImage.texture != null)
		{
			//UM_ShareUtility.TwitterShare("Check my #fidgetspinner speed in www.fisp.io ! #fispio " + Utils.StorePageURL, (Texture2D)ssImage.texture);
		}
	}
}
